Skip to content

Add WebP Converter with batch processing and quality slider#98

Merged
peckz merged 9 commits intomainfrom
copilot/fix-8cc275e6-87f0-45f9-a265-2d6c199d224b
Jul 25, 2025
Merged

Add WebP Converter with batch processing and quality slider#98
peckz merged 9 commits intomainfrom
copilot/fix-8cc275e6-87f0-45f9-a265-2d6c199d224b

Conversation

Copy link
Contributor

Copilot AI commented Jul 23, 2025

Implements a new WebP Converter utility that allows users to convert images to WebP format with batch processing capabilities and adjustable quality control.

🚀 Features

  • Batch Processing: Upload and convert multiple images simultaneously
  • Quality Slider: Adjustable quality from 1-100% with real-time preview
  • Drag & Drop Interface: Intuitive multi-file upload experience
  • File Management: Individual file removal with size display
  • Progress Tracking: Real-time conversion progress indicator
  • Compression Stats: Shows original vs WebP sizes and compression ratio
  • Download Options: Individual downloads or bulk download
  • Error Handling: Graceful handling of unsupported files and conversion errors

📁 Files Added/Modified

  • New Components:

    • pages/utilities/webp-converter.tsx - Main WebP converter page
    • components/ds/MultiFileUploadComponent.tsx - Reusable multi-file upload component
    • components/utils/webp-converter.utils.ts - Core conversion logic and utilities
    • components/utils/webp-converter.utils.test.ts - Comprehensive test suite
  • Modified:

    • components/utils/tools-list.ts - Added WebP converter to utilities list

🛠️ Technical Implementation

Browser Compatibility: Initially attempted to use @squoosh/lib as requested, but it requires Node.js APIs (fs, worker_threads) that aren't available in browsers. Implemented a Canvas API-based solution that provides the same functionality while maintaining full browser compatibility.

Design Consistency: Follows all existing patterns from the codebase:

  • Uses the same component structure and design system
  • Follows TypeScript conventions and testing patterns
  • Maintains consistent user experience with other utilities
  • Integrates seamlessly with the existing tools architecture

📸 Screenshots

WebP Converter Interface:
WebP Converter UI

Added to Utilities List:
Utilities Page

✅ Testing

  • All existing tests continue to pass
  • New comprehensive test suite for utility functions
  • Manual testing verified drag & drop, quality slider, and batch processing functionality
  • Build process successful with no breaking changes

The WebP converter maintains the same high-quality, ad-free, open-source experience as all other jam.dev utilities while providing powerful image conversion capabilities for developers.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jul 23, 2025

Deploying jam-dev-utilities with  Cloudflare Pages  Cloudflare Pages

Latest commit: 79a3748
Status: ✅  Deploy successful!
Preview URL: https://1d101cd7.jam-dev-utilities.pages.dev
Branch Preview URL: https://copilot-fix-8cc275e6-87f0-45.jam-dev-utilities.pages.dev

View logs

@peckz peckz changed the title [WIP] Create a .webp utl converter that supports batch processing of images and has a quality slider. Avoid using canvas; fully rely on the library @squoosh/lib. Follow existing practices from the codebase. Keep it simple. [WIP] Create a .webp converter Jul 23, 2025
Copilot AI and others added 2 commits July 23, 2025 19:07
Co-authored-by: peckz <18050177+peckz@users.noreply.github.com>
Co-authored-by: peckz <18050177+peckz@users.noreply.github.com>
Copilot AI changed the title [WIP] Create a .webp converter Add WebP Converter with batch processing and quality slider Jul 23, 2025
Copilot AI requested a review from peckz July 23, 2025 19:12
Copilot finished work on behalf of peckz July 23, 2025 19:12
@peckz
Copy link
Collaborator

peckz commented Jul 24, 2025

@copilot can we make sure that all components are from shadcn/ui package?
For example quality slider seems custom?

Also, once images are converted, typography could be nicer, it's hard to get clear overview — be inspired by vercel

image

…ts typography

Co-authored-by: peckz <18050177+peckz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 24, 2025

@copilot can we make sure that all components are from shadcn/ui package?
For example quality slider seems custom?

...

Updated to use proper shadcn/ui components:

Slider: Replaced custom range input with shadcn/ui Slider component
Progress: Replaced custom progress bar with shadcn/ui Progress component
Typography: Improved conversion results with card-based layout inspired by Vercel

The conversion results now feature:

  • Large, prominent numbers for successful conversions
  • Card-based layout with proper visual hierarchy
  • Clear size comparison with arrow indicator
  • Highlighted compression ratio display

Commit: c7fedf1

Updated WebP Converter Interface

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ui.shadcn.com
    • Triggering command: node /home/REDACTED/.npm/_npx/d66c5096c7023bfb/node_modules/.bin/shadcn add slider progress --yes (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of peckz July 24, 2025 09:45
@peckz
Copy link
Collaborator

peckz commented Jul 24, 2025

@copilot well, this looks quite good!
can we also add kb / mb for reduction?

image

This block where it says "1 successful" is quite weird since it's 50% and it's aligned to the left.
Can we make it full width and styled a little bit nicer?

Also, the selected files area could use a little bit of inspiration from websites like GitHub or Vercel; the content is misaligned and tiny.

image

Co-authored-by: peckz <18050177+peckz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 24, 2025

@copilot well, this looks quite good!
can we also add kb / mb for reduction?

...

Improved the WebP converter UI based on your feedback:

Added KB/MB reduction display - Now shows actual bytes saved alongside percentage (e.g., "77.4% reduction - 19.3 KB saved")

Fixed conversion results layout - Replaced the awkward 50% width "1 successful" card with a full-width, centered design that looks much cleaner

Enhanced selected files section - Redesigned with GitHub/Vercel-inspired professional file cards featuring:

  • Larger file icons with proper visual containers
  • Better typography and spacing alignment
  • Improved hover states and visual hierarchy
  • Consolidated total size display in the header

The interface now provides a much cleaner overview and professional appearance.

Commit: 0c5b6c4

WebP Converter - Enhanced UI

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • picsum.photos
    • Triggering command: curl -o test1.jpg REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of peckz July 24, 2025 17:36
@peckz
Copy link
Collaborator

peckz commented Jul 25, 2025

@copilot looks quite solid!

Let's move the text "1 Image converted successfully" outside of the box; it could be smaller and formatted differently, as this information is not super important.

Let's also add SEO text below the tool, so people can find it easily via Google.
Keep it short and concise; be inspired by other tools.

It might be a good idea to save quality value to local storage

image

…save quality to localStorage

Co-authored-by: peckz <18050177+peckz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 25, 2025

@copilot looks quite solid!

Let's move the text "1 Image converted successfully" outside of the box; it could be smaller and formatted differently, as this information is not super important.
...

Addressed all feedback:

Moved success text outside box - "1 Image converted successfully" now appears as smaller, less prominent text above the results card instead of inside it

Added SEO content - Created comprehensive WebPConverterSEO component with usage instructions, benefits, FAQs, and related tools following the same pattern as other utilities

Added localStorage persistence - Quality slider value is now automatically saved to localStorage and restored on page reload for better user experience

The interface now has a cleaner layout with the conversion results focused on the actual metrics, while the success message is appropriately de-emphasized.

Commit: 7c60d46

Copilot finished work on behalf of peckz July 25, 2025 09:35
@peckz
Copy link
Collaborator

peckz commented Jul 25, 2025

@copilot cool! I pushed one small commit, can you add one more thing, i would like to have a checkbox that says something like "automatically download after conversion" — this should be also save to local storage

when is checked="true" we should trigger download instantly

…erter

Co-authored-by: peckz <18050177+peckz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 25, 2025

@copilot cool! I pushed one small commit, can you add one more thing, i would like to have a checkbox that says something like "automatically download after conversion" — this should be also save to...

Added the auto-download checkbox feature! ✅

Key features implemented:

  • Checkbox labeled "Automatically download after conversion" using shadcn/ui components
  • localStorage persistence - setting is saved and restored on page reload
  • Instant downloads - when enabled, automatically triggers downloads immediately after successful conversion
  • Placed logically near quality settings with helpful description text

The feature integrates seamlessly with the existing download system and has been tested to work correctly.

Commit: 4b13834

Copilot finished work on behalf of peckz July 25, 2025 13:45
@peckz peckz force-pushed the copilot/fix-8cc275e6-87f0-45f9-a265-2d6c199d224b branch from ee1b8d0 to 79a3748 Compare July 25, 2025 14:04
@peckz peckz marked this pull request as ready for review July 25, 2025 14:07
@peckz peckz merged commit 5a60fba into main Jul 25, 2025
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants